/*
Package service
impelement WebHook service recieve post request and parse data.
*/

package service

import (
	"gitee.com/RocsSun/webhook/pkg/scheduler"
	"github.com/gin-gonic/gin"
)

// Webhooks 返回http。解析丢给后台携程处理。
// TODO Parse WebHook Headers.
func Webhooks(c *gin.Context) {
	scheduler.ReqChan <- c.Request
	c.Status(204)
}

func Auth(ctx *gin.Context) {
	code := ctx.Query("code")
	if code == "" {
		ctx.JSON(200, gin.H{"msg": "Failed to get code"})
		return
	}
}
